// arbitrary precision arithmatic

#include <stdio.h>
#include <stdlib.h>
#define BNLEN 65
void bg_multi(int *a, int b)
{
    for (int i = 0; i < BNLEN; i++)
        a[i] = a[i] * b;
    for (int i = 0; i < BNLEN; i++)
    {
        a[i + 1] += a[i] / 10000;
        a[i] = a[i] % 10000;
    }
}
void bg_sub(int *a, int *b) // endure a>b
{
    for (int i = 0; i < BNLEN; i++)
        a[i] = a[i] - b[i];
    for (int i = 0; i < BNLEN; i++)
        if (a[i] < 0)
        {
            a[i + 1]--;
            a[i] += 10000;
        }
}
int bg_compare(int *a, int *b)
{
    for (int i = BNLEN - 1; i >= 0; i--)
        if (a[i] != b[i])
            return a[i] - b[i];
    return 0;
}
int main(int argc, char const *argv[])
{
    int _a, _b;
    scanf("%d%d", &_a, &_b);
    int *a = (int *)calloc((BNLEN + 1), sizeof(int));
    int *b = (int *)calloc((BNLEN + 1), sizeof(int));
    a[0] = b[0] = 1;
    for (int i = 0; i < _b; i++)
        bg_multi(a, _a);
    for (int i = 0; i < _a; i++)
        bg_multi(b, _b);
    if (bg_compare(a, b) < 0)
    {
        printf("-");
        int *t = a;
        a = b;
        b = t;
    }
    bg_sub(a, b);
    int l = BNLEN - 1;
    while (a[l] == 0 && l > 0)
        l--;
    printf("%d", a[l]);
    for (int i = l - 1; i >= 0; i--)
        printf("%04d", a[i]);
    printf("\n");
    return 0;
}
